﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	x:Class="HeritageAcademy.Library.Controls.ErrorMessage"
	x:Name="UserControl"
	UseLayoutRounding="True"
	d:DesignWidth="383.774" d:DesignHeight="61.494" Height="40">
    
    <UserControl.Resources>
        <Storyboard x:Key="ShowMessage">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-44.0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="CloseMessage">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="44.0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="AutoCloseMessage">
            <!-- HACK!!! wait 3 seconds then close -->
            <!-- HOW TO PAUSE IT CORRECTLY ??? -->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
            	<EasingDoubleKeyFrame KeyTime="0:0:3" Value="-44"/>
            	<EasingDoubleKeyFrame KeyTime="0:0:3.3" Value="44"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
            	<EasingDoubleKeyFrame KeyTime="0:0:3" Value="1"/>
            	<EasingDoubleKeyFrame KeyTime="0:0:3.3" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    
    <UserControl.RenderTransform>
        <TransformGroup>
            <ScaleTransform/>
            <SkewTransform/>
            <RotateTransform/>
            <TranslateTransform/>
        </TransformGroup>
    </UserControl.RenderTransform>
	
    <Grid x:Name="grid">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="12"/>
			<ColumnDefinition Width="0.343*"/>
			<ColumnDefinition Width="0.657*"/>
			<ColumnDefinition Width="51"/>
		</Grid.ColumnDefinitions>
		<Rectangle x:Name="recMarker" Fill="Red" Margin="0"/>
		<TextBlock x:Name="tbMessageType" Text="ИНФОРМАЦИЯ" Grid.Column="1" VerticalAlignment="Center" Margin="10,0,0,0" FontWeight="Bold" TextOptions.TextFormattingMode="Display"/>
		<TextBlock x:Name="tbMessage" TextWrapping="Wrap" Text="НЕВЕРНЫЙ ПАРОЛЬ" Grid.Column="2" VerticalAlignment="Center" Margin="6,0,0,0" TextOptions.TextFormattingMode="Display"/>
	</Grid>
</UserControl>